home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Resources / Chat & Communication / Digsby build 37 / digsby_setup.exe / lib / gui / native / memfootprint.pyo (.txt) < prev    next >
Python Compiled Bytecode  |  2008-10-13  |  1KB  |  46 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.5)
  3.  
  4. import wx
  5. __all__ = [
  6.     'memory_event']
  7. enabled = True
  8.  
  9. def memory_event():
  10.     wx.CallAfter(start_timer)
  11.  
  12.  
  13. def set_enabled(val):
  14.     global enabled
  15.     enabled = bool(val)
  16.  
  17. WAIT_MS = 3000
  18. LONGTERM_MS = 900000
  19. from gui.native import lower_memory_footprint
  20.  
  21. def lower():
  22.     if enabled:
  23.         lower_memory_footprint()
  24.     
  25.  
  26.  
  27. def start_timer():
  28.     t = memtimer()
  29.     if not t.IsRunning():
  30.         t.StartOneShot(WAIT_MS)
  31.     
  32.  
  33.  
  34. def memtimer():
  35.     app = wx.GetApp()
  36.     
  37.     try:
  38.         return app._memory_timer
  39.     except AttributeError:
  40.         timer = app._memory_timer = wx.PyTimer(lower)
  41.         longterm_timer = app._longterm_memory_timer = wx.PyTimer(lower)
  42.         longterm_timer.StartRepeating(LONGTERM_MS)
  43.         return timer
  44.  
  45.  
  46.